//
//  SSClassifyController.m
//  电商项目
//
//  Created by Esther on 2017/2/18.
//  Copyright © 2017年 Esther. All rights reserved.
//

#import "SSClassifyController.h"
#import "SSSearchController.h"

@interface SSClassifyController ()
@property(nonatomic, strong) UIButton *searchButton;

@end

@implementation SSClassifyController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationItem.titleView = self.searchButton;
    
}


#pragma mark -
#pragma mark - 监听
- (void)searchMetod{
    SSSearchController *searchContrller = [[SSSearchController alloc] init];
    [self.navigationController pushViewController:searchContrller animated:YES];
    
}

#pragma mark -
#pragma mark - 懒加载
- (UIButton *)searchButton{
    if (!_searchButton) {
        _searchButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _searchButton.frame = CGRectMake(0, 0, 50, 30);
        _searchButton.backgroundColor = [UIColor ss_randomColor];
        [_searchButton addTarget:self action:@selector(searchMetod) forControlEvents:(UIControlEventTouchUpInside)];
        
    }
    return _searchButton;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
